package com.day240701.controller;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "TeacherServlet", value = "/teacher")
public class TeacherServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String op = request.getParameter("op");
        if ("login".equals(op)) {
            System.out.println("登录操作");
            HttpSession session = request.getSession();
            session.setAttribute("tNo", 666);
            response.sendRedirect("teacher/main.jsp");
        } else if ("queryMyInfo".equals(op)) {
            System.out.println("查看个人信息");
        }
    }
}
